#  Copyright (c) 2014-present, Facebook, Inc.
#  All rights reserved.
#
#  This source code is licensed as defined on the LICENSE file found in the
#  root directory of this source tree.

load("//tools/build_defs/oss/osquery:cxx.bzl", "osquery_cxx_library")
load("//tools/build_defs/oss/osquery:native.bzl", "osquery_target")
load("//tools/build_defs/oss/osquery:platforms.bzl", "LINUX", "MACOSX", "POSIX", "WINDOWS")
load("//tools/build_defs/oss/osquery:third_party.bzl", "osquery_tp_target")

osquery_cxx_library(
    name = "applications",
    srcs = [
        "browser_chrome.cpp",
        "browser_utils.cpp",
        "browser_firefox.cpp",
    ],
    header_namespace = "osquery/tables/applications",
    exported_headers = [
        "browser_utils.h",
    ],
    exported_platform_headers = [
        (
            POSIX,
            [
                "posix/prometheus_metrics.h",
            ],
        ),
    ],
    platform_srcs = [
        (
            POSIX,
            [
                "posix/browser_opera.cpp",
                "posix/carbon_black.cpp",
                "posix/docker.cpp",
                "posix/prometheus_metrics.cpp",
            ],
        ),
        (
            MACOSX,
            [
                "atom_packages.cpp",
                "darwin/browser_plugins.cpp",
            ],
        ),
        (
            LINUX,
            [
                "atom_packages.cpp",
            ],
        ),
        (
            WINDOWS,
            [
                "windows/carbon_black.cpp",
            ],
        ),
    ],
    tests = [
        osquery_target("osquery/tables/applications/posix/tests:prometheus_metrics_tests"),
    ],
    visibility = ["PUBLIC"],
    deps = [
        osquery_target("osquery/config:config"),
        osquery_target("osquery/filesystem:osquery_filesystem"),
        osquery_target("osquery/tables/system:system_table"),
        osquery_target("osquery/utils/conversions:conversions"),
        osquery_target("osquery/utils/info:info"),
        osquery_target("osquery/utils/json:json"),
        osquery_target("plugins/config/parsers:parsers"),
        osquery_tp_target("boost"),
    ],
)
